﻿using System;

namespace ExFlash.Actions
{
    public class UnknownAction : ActionRecord
    {
        public Byte[] Data
        {
            get;
            protected set;
        }

        public UnknownAction(byte code)
            : base(code)
        {
        }
        
        public UnknownAction(byte code,ushort len)
            : base(code, len)
        {
        }

        public override void SwfDeserialize(BinaryBitReader reader)
        {
            if (ActionCode >= 0x80)
            {
                Data = new Byte[Length];
                reader.Read(Data, 0, Length);
            }
            else
            {
                Data = null;
            }
        }

        public override void SwfSerialize(byte[] arr, ref int offset)
        {
            throw new NotImplementedException();
        }
    }
}
